
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.PlanPracticeDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class PlanPracticeDaoJdbc extends BaseDaoJdbc implements PlanPracticeDao {
	String tableName="T_PLAN_PRACTICE";
	String beanName="planPractice";
	
	public CommonBean createPlanPractice(){
		CommonBean planPractices=this.createBean(tableName,beanName);
                return planPractices;		
	}
	
/*
	public CommonBean findPlanPractices(String refid) {
		CommonBean planPractices=this.createPlanPractice();
		String sql="select * from T_PLAN_PRACTICE where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		planPractices.addData(data);
                return planPractices;
       }
*/
	public CommonBean findPlanPracticeById(String id) {
		CommonBean planPractices=this.createPlanPractice();
		String sql="select * from T_PLAN_PRACTICE where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		planPractices.addData(data);
    return planPractices;
  }
  
	public CommonBean findAllPlanPractices() {
		CommonBean planPractices=this.createPlanPractice();
		String sql="select * from T_PLAN_PRACTICE ";
		List data=this.getCommonDao().select(sql,new String[]{});
		planPractices.addData(data);
    return planPractices;
  }
	public void insertPlanPractice(CommonBean planPracticeBean){
		List data=planPracticeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updatePlanPractice(CommonBean planPracticeBean){
		List data=planPracticeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

